﻿using System;
using System.Collections.Generic;
using System.Text;

using System.Data;

namespace CXJ.Interface
{
    public interface IDBOperator
    {
        string ConnectString
        {
            get;
            set;
        }

        void OpenConnection();

        void CloseConnection();

        void BeginTransaction();

        void CommitTransaction();

        void RollbackTransaction();

        IDataParameter CreateParameter(string strParaName, object objParaValue, DbType Dbtype);
        IDataParameter CreateParameter(string strParaName, object objParaValue, DbType Dbtype, int intParaSize);
        IDataParameter CreateParameter(string strParaName, object objParaValue, DbType Dbtype, ParameterDirection Paradirect);
        IDataParameter CreateParameter(string strParaName, object objParaValue, DbType Dbtype, int intParaSize, ParameterDirection Paradirect);
        IDataParameter CreateParameter(string strParaName, object objParaValue, DbType Dbtype, int intPrecision, int intScale, ParameterDirection Paradirect);

        DataSet GetDataSet(string strSql);


        DataSet GetDataSet(string strSql, IDataParameter[] para);

        DataTable GetDataTable(string strSql);

        DataTable GetDataTable(string strSql, IDataParameter[] para);

        object GetDataSingle(string strSql);

        object GetDataSingle(string strSql, IDataParameter[] para);

        int ExecuteSql(string strSql);

        int ExecuteSql(string strSql, IDataParameter[] para);

        void ExecuteProc(string strProcName, IDataParameter[] para);

        void ExecuteProc(string strProcName, ref IDataParameter[] para);

        DataTable ExecuteProcTable(string strSql);

        DataTable ExecuteProcTable(string strSql, IDataParameter[] para);

        IDataReader GetReader(string strSql);
        IDataReader GetReader(string strSql, IDataParameter[] para);
    }
}
